package wog.dubo.business.user.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import wog.dubo.business.user.dao.UserFilmDao;
import wog.dubo.business.user.model.UserFilm;
import wog.dubo.business.user.service.UserFilmService;

import java.sql.SQLException;

@Service
public class UserFilmServiceImpl implements UserFilmService{

    @Autowired
    private UserFilmDao userFilmDao;

    @Override
    public UserFilm gettUserByUserName(String userName) {
        return userFilmDao.selectUserByUserName(userName);
    }

    @Override
    public Integer addUser(UserFilm userFilm) throws SQLException {
        Integer result = userFilmDao.addUser(userFilm);
        if(result<1){
            throw new SQLException();
        }
        return null;
    }
}
